//
//  RegistView.m
//  HappyBug
//
//  Created by liulei on 2018/11/5.
//  Copyright © 2018年 www.hc.com.cn. All rights reserved.
//

#import "RegistView.h"
#import "InputMessageViewController.h"
#define  WHITH   [UIScreen mainScreen].bounds.size.width
#define  HEIGHT  [UIScreen mainScreen].bounds.size.height
@interface RegistView (){
    
}


@end

@implementation RegistView{
}


-(instancetype)initWithFrame:(CGRect)frame{
    
    self=[super initWithFrame:frame];
    if(self){
        [self initView];
    }
    return self;
}

-(void)initView{
    //第一个输入内容
    _txtLineView= [[UIView alloc]init];
    _txtLineView.layer.cornerRadius=3;
    _txtLineView.layer.backgroundColor=[UIColor grayColor].CGColor;
    _txtLineView.frame=CGRectMake(0,0, WHITH, 50);
    _txtLineView.backgroundColor=[UIColor whiteColor];
    _txtLineView.userInteractionEnabled=YES;
    [self addSubview:_txtLineView];

    
    UIView *line =[[UIView alloc]initWithFrame:CGRectMake(0, _txtLineView.frame.origin.y+_txtLineView.frame.size.height, WHITH, 0.5)];
    [line setBackgroundColor:[UIColor grayColor]];
    [self addSubview:line];
    
    _label1 =[[UILabel alloc]init];
    _label1.frame=CGRectMake(10,0, 100, 50);
    _label1.textAlignment=NSTextAlignmentLeft;
    _label1.text=@"姓名";
    _label1.font=[UIFont systemFontOfSize:18];
    [_txtLineView addSubview:_label1];
    
    
    _labeltxt1=[[UILabel alloc]init];
    _labeltxt1.frame=CGRectMake(_label1.frame.size.width+_label1.frame.origin.x-5,0, 100, 50);
    _labeltxt1.font=[UIFont systemFontOfSize:16];
    _labeltxt1.textAlignment=NSTextAlignmentLeft;
    _labeltxt1.text=@"真ss";
    [_txtLineView addSubview:_labeltxt1];
    
    UIImage *image=[UIImage imageNamed:@"nextpng"];
    UIImageView *imageView=[[UIImageView alloc]init];
    imageView.image=image;
    //如果高度不一样 用外面的-里面的高度除以2
    imageView.frame=CGRectMake(WHITH-40,(_txtLineView.frame.size.height-30)/2, 20, 20);
    [_txtLineView addSubview:imageView];
    
    

    
    //第二个输入框
  
    _txtLineView2= [[UIView alloc]init];
    _txtLineView2.layer.cornerRadius=3;
    _txtLineView2.layer.backgroundColor=[UIColor grayColor].CGColor;
    _txtLineView2.frame=CGRectMake(0,_txtLineView.frame.origin.y+_txtLineView.frame.size.height+5, WHITH, 50);
    _txtLineView2.backgroundColor=[UIColor whiteColor];
    _txtLineView2.userInteractionEnabled=YES;
    [self addSubview:_txtLineView2];

    
    _sexTxttitle =[[UILabel alloc]init];
    _sexTxttitle.frame=CGRectMake(10,0, 100, 50);
    _sexTxttitle.textAlignment=NSTextAlignmentLeft;
    _sexTxttitle.text=@"性别";
    _sexTxttitle.font=[UIFont systemFontOfSize:18];
    [_txtLineView2 addSubview:_sexTxttitle];
    
    
    _sexTxt=[[UILabel alloc]init];
    _sexTxt.frame=CGRectMake(_sexTxttitle.frame.size.width+_sexTxttitle.frame.origin.x-5,0, 100, 50);
    _sexTxt.font=[UIFont systemFontOfSize:16];
    _sexTxt.textAlignment=NSTextAlignmentLeft;
    _sexTxt.text=@"男";
    [_txtLineView2 addSubview:_sexTxt];
    
    UIImage *image2=[UIImage imageNamed:@"nextpng"];
    UIImageView *imageView2=[[UIImageView alloc]init];
    imageView2.image=image2;
    //如果高度不一样 用外面的-里面的高度除以2
    imageView2.frame=CGRectMake(WHITH-40,(_txtLineView2.frame.size.height-30)/2, 20, 20);
    [_txtLineView2 addSubview:imageView2];
    
    UIView *line2 =[[UIView alloc]initWithFrame:CGRectMake(0, _txtLineView2.frame.origin.y+_txtLineView2.frame.size.height, WHITH, 0.5)];
    [line2 setBackgroundColor:[UIColor grayColor]];
    [self addSubview:line2];
    
    
    //第三个输入框
    
    
    _txtLineView3= [[UIView alloc]init];
    _txtLineView3.layer.cornerRadius=3;
    _txtLineView3.layer.backgroundColor=[UIColor grayColor].CGColor;
    _txtLineView3.frame=CGRectMake(0,_txtLineView2.frame.origin.y+_txtLineView2.frame.size.height+5, WHITH, 50);
    _txtLineView3.backgroundColor=[UIColor whiteColor];
    _txtLineView3.userInteractionEnabled=YES;
    [self addSubview:_txtLineView3];

    
    _ageTxttitle =[[UILabel alloc]init];
    _ageTxttitle.frame=CGRectMake(10,0, 100, 50);
    _ageTxttitle.textAlignment=NSTextAlignmentLeft;
    _ageTxttitle.text=@"年龄";
    _ageTxttitle.font=[UIFont systemFontOfSize:18];
    [_txtLineView3 addSubview:_ageTxttitle];
    
    
    _ageTxt=[[UILabel alloc]init];
    _ageTxt.frame=CGRectMake(_ageTxttitle.frame.size.width+_ageTxttitle.frame.origin.x-5,0, 100, 50);
    _ageTxt.font=[UIFont systemFontOfSize:16];
    _ageTxt.textAlignment=NSTextAlignmentLeft;
    _ageTxt.text=@"109";
    [_txtLineView3 addSubview:_ageTxt];
    
    UIImage *image3=[UIImage imageNamed:@"nextpng"];
    UIImageView *imageView3=[[UIImageView alloc]init];
    imageView3.image=image3;
    //如果高度不一样 用外面的-里面的高度除以2
    imageView3.frame=CGRectMake(WHITH-40,(_txtLineView3.frame.size.height-30)/2, 20, 20);
    [_txtLineView3 addSubview:imageView3];
    
    
    UIView *line3 =[[UIView alloc]initWithFrame:CGRectMake(0, _txtLineView3.frame.origin.y+_txtLineView3.frame.size.height, WHITH, 0.5)];
    [line3 setBackgroundColor:[UIColor grayColor]];
    [self addSubview:line3];
    //第四个输入框
    
    
    
    _txtLineView4= [[UIView alloc]init];
    _txtLineView4.layer.cornerRadius=3;
    _txtLineView4.layer.backgroundColor=[UIColor grayColor].CGColor;
    _txtLineView4.frame=CGRectMake(0,_txtLineView3.frame.origin.y+_txtLineView3.frame.size.height+5, WHITH, 50);
    _txtLineView4.backgroundColor=[UIColor whiteColor];
    _txtLineView4.userInteractionEnabled=YES;
    [self addSubview:_txtLineView4];

    
    _addressTxttitle =[[UILabel alloc]init];
    _addressTxttitle.frame=CGRectMake(10,0, 100, 50);
    _addressTxttitle.textAlignment=NSTextAlignmentLeft;
    _addressTxttitle.text=@"故乡";
    _addressTxttitle.font=[UIFont systemFontOfSize:18];
    [_txtLineView4 addSubview:_addressTxttitle];
    
    
    _addressTxt=[[UILabel alloc]init];
    _addressTxt.frame=CGRectMake(_addressTxttitle.frame.size.width+_addressTxttitle.frame.origin.x-5,0, 100, 50);
    _addressTxt.font=[UIFont systemFontOfSize:16];
    _addressTxt.textAlignment=NSTextAlignmentLeft;
    _addressTxt.text=@"北京";
    [_txtLineView4 addSubview:_addressTxt];
    
    UIImage *image4=[UIImage imageNamed:@"nextpng"];
    UIImageView *imageView4=[[UIImageView alloc]init];
    imageView4.image=image4;
    //如果高度不一样 用外面的-里面的高度除以2
    imageView4.frame=CGRectMake(WHITH-40,(_txtLineView4.frame.size.height-30)/2, 20, 20);
    [_txtLineView4 addSubview:imageView4];
    
    UIView *line4 =[[UIView alloc]initWithFrame:CGRectMake(0, _txtLineView4.frame.origin.y+_txtLineView4.frame.size.height, WHITH, 0.5)];
    [line4 setBackgroundColor:[UIColor grayColor]];
    [self addSubview:line4];
    //5
    
    _txtLineView5= [[UIView alloc]init];
    _txtLineView5.layer.cornerRadius=3;
    _txtLineView5.layer.backgroundColor=[UIColor grayColor].CGColor;
    _txtLineView5.frame=CGRectMake(0,_txtLineView4.frame.origin.y+_txtLineView4.frame.size.height+5, WHITH, 50);
    _txtLineView5.backgroundColor=[UIColor whiteColor];
    _txtLineView5.userInteractionEnabled=YES;
    [self addSubview:_txtLineView5];

    
    _selfTxttitle =[[UILabel alloc]init];
    _selfTxttitle.frame=CGRectMake(10,0, 100, 50);
    _selfTxttitle.textAlignment=NSTextAlignmentLeft;
    _selfTxttitle.text=@"简介";
    _selfTxttitle.font=[UIFont systemFontOfSize:18];
    [_txtLineView5 addSubview:_selfTxttitle];
    
    
    _selfTxt=[[UILabel alloc]init];
    _selfTxt.frame=CGRectMake(_selfTxttitle.frame.size.width+_selfTxttitle.frame.origin.x-5,0, 100, 50);
    _selfTxt.font=[UIFont systemFontOfSize:16];
    _selfTxt.textAlignment=NSTextAlignmentLeft;
    _selfTxt.text=@"..";
    [_txtLineView5 addSubview:_selfTxt];
    
    UIImage *image5=[UIImage imageNamed:@"nextpng"];
    UIImageView *imageView5=[[UIImageView alloc]init];
    imageView5.image=image5;
    //如果高度不一样 用外面的-里面的高度除以2
    imageView5.frame=CGRectMake(WHITH-40,(_txtLineView4.frame.size.height-30)/2, 20, 20);
    [_txtLineView5 addSubview:imageView5];
    
    UIView *line5 =[[UIView alloc]initWithFrame:CGRectMake(0, _txtLineView5.frame.origin.y+_txtLineView5.frame.size.height, WHITH, 0.5)];
    [line5 setBackgroundColor:[UIColor grayColor]];
    [self addSubview:line5];
}

-(void)click:(UIGestureRecognizer *)ges{
    NSLog(@"1");
}

//沙盒获取
- (UIImage *)getImageWithjImageName:(NSString *)imageName {
    
    NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory,NSUserDomainMask, YES);
    
    NSString *filePath = [[paths objectAtIndex:0]stringByAppendingPathComponent:
                          imageName];
    // 保存文件的名称
    UIImage *img = [UIImage imageWithContentsOfFile:filePath];
    NSLog(@"=== %@", img);
    
    return img;
    
}
@end
